package javaStudy.线程.线程控制;

public class ThreadSleep extends Thread{
    @Override
    public void run() {
        for (int i = 0; i < 100; i++) {
            System.out.println(getName() + ":" + i);
            try {
    //static void sleep():使线程停留指定时间
                Thread.sleep(1000);//1000毫秒
            } catch (InterruptedException e) {
                throw new RuntimeException(e);
            }
        }
    }
}
